import { IApi } from "./utils/getMockData";
import parseRequireDeps from "./utils/parseRequireDeps";

export default function (api:IApi){
  
}

export const registerBabel = (paths: string[]): void => {
  // support
  // clear require cache and set babel register
  const requireDeps = paths.reduce((memo: string[], file) => {
    memo = memo.concat(parseRequireDeps(file));
    return memo;
  }, []);
  requireDeps.forEach((f) => {
    if (require.cache[f]) {
      delete require.cache[f];
    }
  });
  // console.log(requireDeps,'requireDepsrequireDeps')
  // api.babelRegister.setOnlyMap({
  //   key: 'mock',
  //   value: [...paths, ...requireDeps],
  // });
};